<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<script language="javascript" type="text/javascript">
				function sedit(id,name){
					$("#subSort-name").val(unescape(name));
					$("#infoSortSubSubmitBtn").val("修改");
					$("#sid").val(id);
					$("#infoSubSortForm").attr("action","<%=basePath%>/info/updateSubSort");
				}
				function sdelete(id){
					$.ajax({
						type : "POST",
						dataType : "html",
						url : "<%=basePath%>/info/deleteSubSort",
						data : {
							id : id
						},
						success : function() {
							alert('删除成功');
							location.reload();
						}
					});
				}
				$(function(){
					/* 新建栏目的ajax表单提交 */
					$("#infoSortSubSubmitBtn").click(function() {
						$("#infoSubSortForm").ajaxSubmit({success : function(data) {
								alert($("#infoSortSubSubmitBtn").val()+"成功!");
								location.reload();
							}});
							return false;
						});
				});
		</script>

<div class="generalbox overview_block">
	<div
		class="generalbox_header overview_veryunevenlargecolumn_width generalbox_header_heavy">
		<div class="box_leftheader generalbox_leftheader">
			<img class="inlineicon transparentpng" height="16" alt=""
				src="<%=basePath%>/images/document.png" width="16" />
			资讯二级栏目设置
		</div>
		<div class="clearer"></div>
	</div>
	<div
		class="generalbox_body generalbox_background_white overview_veryunevenlargecolumn_width">
		<div class="singlecontent_block">
			<table class="pn-ftable" width="100%" cellspacing="1" cellpadding="0"
				border="0" align="center">
				<thead class="pn-lthead" align="center">
					<tr>
						<th>
							ID
						</th>
						<th>
							二级资讯栏目
						</th>
						<th>
							文档数量
						</th>
						<th>
							创建日期
						</th>
						<th>
							操作
						</th>
					</tr>
				</thead>
				<tbody class="pn-ltbody">
					<s:iterator value="infoSubSortList" id="issl">
						<tr id="result">
							<td>
								${issl.id }
							</td>
							<td id="nsl-name">
								${issl.name }
							</td>
							<td>
								${issl.infoItem.size() }
							</td>
							<td>
								${issl.created }
							</td>
							<td class="pn-lopt">
								<a href="javascript:sedit(${issl.id },escape('${issl.name }'));"
									class="pn-loperator">修改</a>┆
								<a href="javascript:sdelete(${issl.id });" class="pn-loperator">删除</a>
							</td>
						</tr>
					</s:iterator>
				</tbody>
			</table>
		</div>
	</div>
</div>
<br />
<div class="generalbox overview_block">
	<div
		class="generalbox_header overview_veryunevenlargecolumn_width generalbox_header_heavy">
		<div class="box_leftheader generalbox_leftheader">
			<img class="inlineicon transparentpng" height="16" alt=""
				src="<%=basePath%>/images/document.png" width="16" />
			资讯二级栏目操作
		</div>
		<div class="clearer"></div>
	</div>
	<div
		class="generalbox_body generalbox_background_white overview_veryunevenlargecolumn_width">
		<div class="singlecontent_block">
			<form action="<%=basePath%>/info/addSubSort" method="post"
				id="infoSubSortForm">
				<input type="hidden" id="sid" name="id" />
				<table class="pn-ltable" width="50%" cellspacing="1" cellpadding="0"
					border="0" align="center">
					<tr>
						<td>
							栏目名称：
						</td>
						<td>
							<input id="subSort-name" type="text" name="infoSubSort.name" />
						</td>
						<td valign="top" class="BodyTextSmall" colspan="2" align="right">
							<input type="button" id="infoSortSubSubmitBtn" value="添加" />
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</div>
<br />